package com.wlz.jvm.three;

/**
 *  三色标记
 * @author wlz
 * @date 2022-03-22  8:03 下午
 */
public class ThreeColorRemark {

    public static void main(String[] args) {
        A a = new A();
        D d = a.b.d;   // 1. 读
        a.b.d = null;  // 2. 写
        a.d = d;       // 3. 写
    }

}


class A {
    B b = new B();
    D d = null;
}

class B {
    C c = new C();
    D d = new D();
}

class C {

}

class D {

}